package com.qf.hospital.VO;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.qf.hospital.serialize.HiddenCarIdJsonSerializer;

import java.util.Date;

/**
 * @author 何星宇
 * @version V1.0
 * @Date 2021/10/20 10:58
 */
public class ReportVO {

    private Integer reportId;

    private String reportName;

    //和实体类不同
    @JsonProperty("department")
    private String departmentName;

    //和实体类不同
    @JsonProperty("doctorName")
    private String doctorName;

    //和实体类不同
    @JsonProperty("registeredType")
    private String registeredType;

    @JsonProperty("datime")
    @JsonFormat(pattern = "yyyy-MM-dd")
    private Date time;

    private String phone;

    @JsonSerialize(using = HiddenCarIdJsonSerializer.class)
    private String carid;

    //属性为 空（""） 或者为 NULL 都不序列化
    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private String sex;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Integer age;

    @JsonInclude(JsonInclude.Include.NON_EMPTY)
    private Double price;

    @Override
    public String toString() {
        return "ReportVO{" +
                "reportId=" + reportId +
                ", reportName='" + reportName + '\'' +
                ", departmentName='" + departmentName + '\'' +
                ", doctorName='" + doctorName + '\'' +
                ", registeredType='" + registeredType + '\'' +
                ", time=" + time +
                ", phone='" + phone + '\'' +
                ", carid='" + carid + '\'' +
                ", sex='" + sex + '\'' +
                ", age=" + age +
                ", price=" + price +
                '}';
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex;
    }

    public Integer getAge() {
        return age;
    }

    public void setAge(Integer age) {
        this.age = age;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Integer getReportId() {
        return reportId;
    }

    public void setReportId(Integer reportId) {
        this.reportId = reportId;
    }

    public String getReportName() {
        return reportName;
    }

    public void setReportName(String reportName) {
        this.reportName = reportName;
    }

    public String getDepartmentName() {
        return departmentName;
    }

    public void setDepartmentName(String departmentName) {
        this.departmentName = departmentName;
    }

    public String getDoctorName() {
        return doctorName;
    }

    public void setDoctorName(String doctorName) {
        this.doctorName = doctorName;
    }

    public String getRegisteredType() {
        return registeredType;
    }

    public void setRegisteredType(String registeredType) {
        this.registeredType = registeredType;
    }

    public Date getTime() {
        return time;
    }

    public void setTime(Date time) {
        this.time = time;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getCarid() {
        return carid;
    }

    public void setCarid(String carid) {
        this.carid = carid;
    }
}
